package com.sjgtw.cloud.common.core.utils;

public class CommonUtil {

    public static String addComma(String str) {
        if (StringUtils.isBlank(str)) {
            return "";
        } else {
            if (!str.startsWith(",")) {
                str = "," + str;
            }

            if (!str.endsWith(",")) {
                str = str + ",";
            }

            return str;
        }
    }

    public static String reduceComma(String str) {
        if (StringUtils.isBlank(str)) {
            return "";
        } else {
            if (str.startsWith(",")) {
                str = str.substring(1);
            }

            if (str.endsWith(",")) {
                str = str.substring(0, str.length() - 1);
            }

            return str;
        }
    }


}
